<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<!-- start the processing -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>Apache JMeter - User's Manual: Building an LDAP Test Plan</title>
<style>
  .code { font-weight: bold; }
</style>
</head>

<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img style="margin: 0px 30px 0px 0px" title="Apache Software Foundation" width="261" height="106" src="../../docs/images/asf-logo.png" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="259" height="88" src="../../docs/images/jmeter.png" alt="Apache JMeter" title="Apache JMeter" border="0"/></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ldapext-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ftp-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="building"><strong>8a. Building an LDAP Test Plan</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>In this section, you will learn how to create a basic Test Plan to test an LDAP server.
You will create four users that send requests for four tests on the LDAP server. Also, you will tell
the users to run their tests 4 times. So,  the total number of requests is (4 users) x (4 requests) x
(repeat 4 times) = 64 LDAP requests. To construct the Test Plan, you will use the following elements:
<a href="test_plan.html#thread_group">Thread Group</a>,
<a href="../usermanual/component_reference.html#LDAP_Request">LDAP Request</a>,
<a href="../usermanual/component_reference.html#LDAP_Request_Defaults">LDAP Request Defaults</a>, and
<a href="../usermanual/component_reference.html#View_Results_in_Table">View Results in Table</a>
.</p><p>This example assumes that the LDAP Server is available at ldap.test.com.</p></blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="adding_users"><strong>8a.1 Adding Users</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>The first step you want to do with every JMeter Test Plan is to add a Thread Group element.
The Thread Group tells JMeter the number of users you want to simulate, how often the users should send
requests, and the how many requests  they should send.</p><p>Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your
right mouse button to get the  <span class="menuchoice">
 <span class="guimenuitem">Add</span>  </span>
 menu, and then select
 <span class="menuchoice">
 <span class="guimenuitem">Add</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">ThreadGroup</span>  </span>
. You should now see the
Thread Group element under Test Plan. If you do not see the element, then &quot;expand&quot; the Test Plan tree by
clicking on the Test Plan element.
<table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/threadgroup.png"/><br>
<font size="-1">
Figure 8a.1. Thread Group and final test tree</font></td></tr></table>


</p></blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_login"><strong>8a.2 Adding Login Config Element</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>Begin by selecting the <tt class="code">LDAP Users</tt> element. Click your right mouse
button to get the Add menu, and then select
   <span class="menuchoice">
 <span class="guimenuitem">Add</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Config Element</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Login Config Element</span>  </span>
.
Then,  select this new element to view its Control Panel.</p><p>Like most JMeter elements, the <tt class="code">Login  Config Element</tt>'s Control Panel has a name
field that you can modify. In this example, leave this field with the default value.</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/login-config-element.png"/><br>
<font size="-1">
  Figure 8a.2 Login Config Element for our Test Plan</font></td></tr></table>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td><p>Enter Username field to &quot;your LDAP Username&quot;,<br>

        The password field to &quot;your LDAP Password&quot;</p>

        <p>These values will be used by the LDAP Requests.</p></td></tr>
</table>
</p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_defaults"><strong>8a.3 Adding LDAP Request Defaults</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>Begin by selecting the <tt class="code">LDAP Users</tt> element. Click your right mouse button
to get the  <span class="menuchoice">
 <span class="guimenuitem">Add</span>  </span>
 menu, and then select
 <span class="menuchoice">
 <span class="guimenuitem">Add</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Config Element</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">LDAP Request Defaults</span>  </span>
. Then,
select this new element to view its Control Panel.</p><p>Like most JMeter elements, the <tt class="code">LDAP Request Defaults</tt> Control Panel has a name
field that you can modify. In this example, leave this field with the default value.</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/requestdefaults.png"/><br>
<font size="-1">
  Figure 8a.3 LDAP Defaults for our Test Plan</font></td></tr></table>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Enter <tt class="code">DN</tt> field to &quot;<tt class="code">your LDAP Root Distinguished Name</tt>&quot;.<br>

                Enter LDAP Server's <tt class="code">Servername</tt> field to &quot;<tt class="code">ldap.test.com</tt>&quot;.<br>

        The <tt class="code">port</tt> to <tt class="code">389</tt>.<br>

        These values are default for the LDAP Requests.</td></tr>
</table>
</p>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_requests"><strong>8a.4 Adding LDAP Requests</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>In our Test Plan, we need to make four LDAP requests.</p><ol>
            <li>Inbuilt Add Test</li>
            <li>Inbuilt Search Test</li>
            <li>Inbuilt Modify Test</li>
            <li>Inbuilt Delete Test</li>

        </ol><p>JMeter sends requests in the order that you add them to the tree.
Start by adding the first LDAP Request to the LDAP Users element
( <span class="menuchoice">
 <span class="guimenuitem">Add</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Sampler</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">LDAP Request</span>  </span>
). Then, select the LDAP Request  element in the tree
and edit the following properties</p><ol>
            <li>Rename to &quot;<tt class="code">Add</tt>&quot; this element</li>
            <li>Select the <tt class="code">Add Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
        </ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/add.png"/><br>
<font size="-1">
                  Figure 8a.4.1 LDAP Request for Inbuilt Add test</font></td></tr></table>
<p>You do not have to set the <tt class="code">Servername</tt> field, <tt class="code">port</tt> field, <tt class="code">Username</tt>, <tt class="code">Password</tt>
and <tt class="code">DN</tt> because you already specified this value in the <tt class="code">Login Config Element</tt> and
<tt class="code">LDAP Request Defaults.</tt></p><p>Next, add the second LDAP Request and edit the following
properties</p><ol>
            <li>Rename to &quot;<tt class="code">Search</tt>&quot; this element</li>
            <li>Select the <tt class="code">Search Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
        </ol><p>
        Next, add the Third LDAP Request and edit the following properties
        </p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/search.png"/><br>
<font size="-1">
                  Figure 8a.4.2 LDAP Request for Inbuilt Search test</font></td></tr></table>
<ol>
            <li>Rename to &quot;<tt class="code">Modify</tt>&quot; this element</li>
            <li>Select the <tt class="code">Modify Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
        </ol><p>
        Next, add the fourth LDAP Request and edit the following properties
        </p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/modify.png"/><br>
<font size="-1">
                  Figure 8a.4.3 LDAP Request for Inbuilt Modify test</font></td></tr></table>
<ol>
            <li>Rename to &quot;<tt class="code">Delete</tt>&quot; this element</li>
            <li>Select the <tt class="code">Delete Test</tt> radio button in <tt class="code">Test Configuration</tt> group</li>
        </ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/delete.png"/><br>
<font size="-1">
                  Figure 8a.4.4 LDAP Request for Inbuilt Delete test</font></td></tr></table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="ResponseAssertion"><strong>8a.5 Adding a Response Assertion</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>You can add a Response Assertion element.
 This element will check the received response data by verifying if the response text is &quot;<tt class="code">successful</tt>&quot;.
  ( <span class="menuchoice">
 <span class="guimenuitem">Add</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Assertion</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Response Assertion</span>  </span>
).</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Note: A this position in the tree,
  the Response Assertion will be executed for each LDAP Request.</td></tr>
</table>
</p>
<ol>
            <li>Select <tt class="code">Text Response</tt> Radio button in <tt class="code">Response Field to Test</tt> group</li>
            <li>Select <tt class="code">Substring</tt> Radio button in <tt class="code">Pattern Matching Rules</tt> group</li>
            <li>Click on <tt class="code">Add</tt> button and add the string &quot;<tt class="code">successful</tt>&quot; in <tt class="code">Pattern to Test</tt> field</li>
        </ol><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/responseassertion.png"/><br>
<font size="-1">
  Figure 8a.5 LDAP Response Assertion</font></td></tr></table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add_listener"><strong>8a.6 Adding a Listener to View/Store the Test Results</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>The final element you need to add to your Test Plan is a Listener.
 This element is responsible for storing all of the results of your LDAP
requests in a file  and presenting a visual model of the data. Select the LDAP
Users element and add a View Results in Table
( <span class="menuchoice">
 <span class="guimenuitem">Add</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">Listener</span>&nbsp;&rarr;&nbsp;<span class="guimenuitem">View Results in Table</span>  </span>
)</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img  src="../../docs/images/screenshots/ldaptest/viewtable.png"/><br>
<font size="-1">
  Figure 8a.6 View Results in Table Listener</font></td></tr></table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ldapext-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="build-ftp-test-plan.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font color="#525D76" size="-1"><em>
Copyright &copy; 1999-2020, Apache Software Foundation
</em></font>
</td>
<td align="right">
<font color="#525D76" size="-1"><em>
$Id$
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!-- end the processing -->















































